package com.xajava.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Resp<T> {

    private Integer code;
    private String status;
    private T data;



    public Resp<String> success(){
        return new Resp<String>(200,"success",null);
    }
    public Resp<T> success(T data){
        return new Resp<T>(200,"success",data);
    }

    public Resp<String> fail(){
        return new Resp<String>(400,"fail",null);
    }

    public Resp<T> fail(T data){
        return new Resp<T>(400,"fail",data);
    }








}
